/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sqlgenerators.search;

import entities.Search;

/**
 *
 * @author damfercer
 */
public class SearchSQLGenerator implements SearchSqlGeneratorInterface{
    private String sql;
    public SearchSqlGeneratorInterface basicSearchSQLGenerator;
    public SearchSqlGeneratorInterface advancedSearchSQLGenerator;
    
    public SearchSQLGenerator(){
        basicSearchSQLGenerator=new BasicSearchSQLGenerator();
        advancedSearchSQLGenerator=new AdvancedSearchSQLGenerator();
    }
    
    public SearchSQLGenerator(SearchSqlGeneratorInterface basicSearchSQLGenerator, SearchSqlGeneratorInterface advancedSearchSQLGenerator){
        this.basicSearchSQLGenerator=basicSearchSQLGenerator;
        this.advancedSearchSQLGenerator=advancedSearchSQLGenerator;
    }

    @Override
    public String getSqlFromSearch(Search search) {
        sql="";
        sql+=basicSearchSQLGenerator.getSqlFromSearch(search);
        sql+=advancedSearchSQLGenerator.getSqlFromSearch(search);
        return sql;
    }
}
